package com.jast.business.service.impl;

import java.util.List;
import com.jast.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jast.business.mapper.BigdataHdfsKvMapper;
import com.jast.business.domain.BigdataHdfsKv;
import com.jast.business.service.IBigdataHdfsKvService;
import com.jast.common.core.text.Convert;

/**
 * HDFS监控指标最新值Service业务层处理
 * 
 * @author Jast
 * @date 2023-02-08
 */
@Service
public class BigdataHdfsKvServiceImpl implements IBigdataHdfsKvService 
{
    @Autowired
    private BigdataHdfsKvMapper bigdataHdfsKvMapper;

    /**
     * 查询HDFS监控指标最新值
     * 
     * @param id HDFS监控指标最新值主键
     * @return HDFS监控指标最新值
     */
    @Override
    public BigdataHdfsKv selectBigdataHdfsKvById(Long id)
    {
        return bigdataHdfsKvMapper.selectBigdataHdfsKvById(id);
    }

    /**
     * 查询HDFS监控指标最新值列表
     * 
     * @param bigdataHdfsKv HDFS监控指标最新值
     * @return HDFS监控指标最新值
     */
    @Override
    public List<BigdataHdfsKv> selectBigdataHdfsKvList(BigdataHdfsKv bigdataHdfsKv)
    {
        return bigdataHdfsKvMapper.selectBigdataHdfsKvList(bigdataHdfsKv);
    }

    /**
     * 新增HDFS监控指标最新值
     * 
     * @param bigdataHdfsKv HDFS监控指标最新值
     * @return 结果
     */
    @Override
    public int insertBigdataHdfsKv(BigdataHdfsKv bigdataHdfsKv)
    {
        bigdataHdfsKv.setCreateTime(DateUtils.getNowDate());
        return bigdataHdfsKvMapper.insertBigdataHdfsKv(bigdataHdfsKv);
    }

    /**
     * 更新/新增HDFS监控指标最新值
     *
     * @param bigdataHdfsKv HDFS监控指标最新值
     * @return 结果
     */
    @Override
    public int upsertBigdataHdfsKv(BigdataHdfsKv bigdataHdfsKv)
    {
                bigdataHdfsKv.setUpdateTime(DateUtils.getNowDate());
            return bigdataHdfsKvMapper.upsertBigdataHdfsKv(bigdataHdfsKv);
    }

    /**
     * 修改HDFS监控指标最新值
     * 
     * @param bigdataHdfsKv HDFS监控指标最新值
     * @return 结果
     */
    @Override
    public int updateBigdataHdfsKv(BigdataHdfsKv bigdataHdfsKv)
    {
        bigdataHdfsKv.setUpdateTime(DateUtils.getNowDate());
        return bigdataHdfsKvMapper.updateBigdataHdfsKv(bigdataHdfsKv);
    }

    /**
     * 批量删除HDFS监控指标最新值
     * 
     * @param ids 需要删除的HDFS监控指标最新值主键
     * @return 结果
     */
    @Override
    public int deleteBigdataHdfsKvByIds(String ids)
    {
        return bigdataHdfsKvMapper.deleteBigdataHdfsKvByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除HDFS监控指标最新值信息
     * 
     * @param id HDFS监控指标最新值主键
     * @return 结果
     */
    @Override
    public int deleteBigdataHdfsKvById(Long id)
    {
        return bigdataHdfsKvMapper.deleteBigdataHdfsKvById(id);
    }
}
